﻿using Biz;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BusinessLayer.Dal
{
    public class ProductImageDal
    {
        public static void Insert(ProductImage img)
        {
            DatabaseContext.DB.ProductImages.Add(img);
            DatabaseContext.DB.SaveChanges();
        }

        public static List<ProductImage> GetImagesOf(Product p)
        {
            return DatabaseContext.DB.ProductImages.Where(i => i.Product.Id == p.Id).ToList();
        }
    }
}
